<?php

	if($_POST)
	{
		$data = array(
			'name'=>$_POST['title'],
			'description'=>$_POST['descrption'],
			'sourcefile'=>$sourcefile,
			'sourceurl'=>$_POST['sourcelink'],
			'imgfile'=>$imgfile,
			'imgurl'=>$_POST['photolink']
		);
		if($_->source->_insert($data))
		{
			header('location:?res=1');exit;
		}
	}
	
	$notice = $_GET['res']==1?'1':'0';
	$smarty->_assign(array('notice'));
	$smarty->_display();
?>